using System;
using System.Collections.Generic;
using System.Text;

namespace Coding.Methods
{
    public class NoneCoding: CodingMethod
    {
        /// <summary>
        /// konwersja bez kompresji
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        public MyBitVector Compress(List<int> values)
        {
            byte[] tmp = new byte[values.Count * 4];


            int j = 0;
            foreach (int i in values)
            {
                IntConverter.ToBytes(i, ref tmp, j);
                j += 4;
            }
            return new MyBitVector(tmp);
        }


        public List<int> Decompress(MyBitVector array)
        {
            List<int> result = new List<int>();

            byte[] bytes = array.ToByteArray();

            for (int i = 0; i < bytes.Length / 4; i++)
            {
                result.Add(IntConverter.FromBytes(bytes, 4 * i));
            }

            return result;
        }

    
    }
}
